﻿
#ifndef _PYSCRIPTAGENTAPI_H_
#define _PYSCRIPTAGENTAPI_H_

#include "PythonApi.hpp"
#include "../OLApp/defines.hpp"
#include "../OLCore/AbstractScriptAgent.hpp"
#include <QObject>


namespace NSPython {

	class PYTHONAPI PyScriptAgent :
		public NSCore::AbstractScriptAgent
	{
		Q_OBJECT
		DECSINGLETON(PyScriptAgent, NSCore::AbstractScriptAgent())
	public:
		static void init(
			int flags = PythonQt::IgnoreSiteModule | PythonQt::RedirectStdOut, 
			const QByteArray& pythonQtModuleName = QByteArray()
		);
		void setRecord(bool record) { m_record = record; }
		void runCommand(QString script);

	public:
		void Initialize();
		void Finalize();

	public:
		inline QString className() override { return "PyScriptAgent"; };
	private:
		bool m_record{ false };

	};

}

#if defined(scriptAgent)
#undef scriptAgent
#else 
#define scriptAgent NSPython::PyScriptAgent::getInstance()
#endif

#endif

